<%@ page pageEncoding="UTF-8" %>
<script src="<c:url value='/resources/js/manage.js'/>"></script>
<c:import url="../../../template/layout.jsp" charEncoding="UTF-8">
    <c:param name="title" value="简历列表"/>
    <c:param name="body">

        <div class="content-title">简历列表
            <p>${message.msg}</p>
        </div>
        <div class="container"
             style="background-color:#DCEAF4; width:1300px; height:500px;border-radius: 0px 0px 0px 0px;">
            <c:if test="${message!=null}">
                <div class="alert alert-danger" role="alert">${message.msg}</div>
            </c:if>

            <p></p>

            <div class="col-sm-5 col-sm-offset-1">
                <form id="searchForm" method="get" action="/system/resume/list"
                      name="user">
                    <div class="input-group">
                        <input id="pageNo" name="pageNo" type="hidden" value="${pager.pageNo}"/>
                        <input id="pageSize" name="pageSize" type="hidden" value="${pager.pageSize}"/>


                    </div>
                </form>
            </div>

            <div class="main-content">

                <table class="table">
                    <thead>
                    <tr>
                        <th>姓名</th>
                        <th>申请职位</th>
                        <th>性别</th>
                        <th>期待薪资</th>
                        <th>操作</th>
                    </tr>
                    </thead>
                    <tbody>
                    <c:forEach items="${pager.list}" var="resume">
                        <tr class="success">
                            <td>${resume.name}</td>
                            <td>${resume.job}</td>
                            <c:if test="${resume.sex}">
                            <td>男</td>
                            </c:if>
                            <c:if test="${!resume.sex}">
                                <td>女</td>
                            </c:if>
                            <c:if test="${resume.expect_salar == 0}">
                                <td>待定</td>
                            </c:if>
                            <c:if test="${resume.expect_salar != 0}">
                            <td>${resume.expect_salar}</td>
                            </c:if>
                            <td>
                                <button onclick="getResume('<c:url value="/system/resume/getResume?id=${resume.id}"/>')"
                                        class="btn btn-primary btn-xs"
                                        data-toggle="modal" data-target="#getResume">查看
                                </button>
                                &nbsp;&nbsp;
                                <button class="btn btn-primary btn-xs"
                                        href="javascript:void(0)" data-toggle="tooltip" title="删除"
                                        onclick="if (confirm('确认要删除本记录吗？此操作将不可恢复！'))
                                                location = '<c:url
                                                value="/system/resume/delete?id=${resume.id}"/>';
                                                return false;">删除
                                </button>


                            </td>
                        </tr>
                    </c:forEach>
                    </tbody>
                </table>
            </div>
            <div class="row">
                <div class="col-sm-12">
                        ${pager}
                </div>
            </div>
        </div>
        <script type="text/javascript">

            function getResume(path) {
                $.ajax({
                    url: path,
                    type: 'get',
                    async: true,
                    dataType: 'json',
                    success: function (resume) {
                        $('#name').html(resume.name);
                        if(resume.sex)
                            $('#sex').html("男");
                        else
                            $('#sex').html("女");

                        $('#age').html(resume.age);
                        $('#job').html(resume.job);
                        $('#mobile').html(resume.mobile);
                        $('#emai').html(resume.email)
                        $('#forward').html(resume.forward);
                        if(resume.expect_salar == 0)
                            $('#expect_salar').html("待定");
                        else
                            $('#expect_salar').html(resume.expect_salar);
                        $('#expression').html(resume.expression);
                        $('#honor').html(resume.honor)
                        $('#skill').html(resume.skill);
                    }
                });
            }


        </script>
        <%--详细显示简历信息模态框--%>
        <div class="modal fade" id="getResume" tabindex="-1" role="dialog">
            <div class="modal-dialog modal-lg">
                <div class="modal-content">
                    <div class="modal-header">
                        <button type="button" class="close" data-dismiss="modal">
                            <span aria-hidden="true">&times;</span>
                            <span class="sr-only">Close</span>
                        </button>
                        <h3 class="modal-title">查看</h3>
                    </div>
                    <div class="modal-body">
                        <div class="form-group">
                            <label class="control-label">姓名</label>
                            <span type="text" class="form-control" id="name"></span>
                        </div>

                        <div class="form-group">
                            <label class="control-label">性别</label>
                            <span type="text" class="form-control" id="sex"></span>
                        </div>
                        <div class="form-group">
                            <label class="control-label">年龄</label>
                            <span type="text" class="form-control" id="age"></span>
                        </div>

                        <div class="form-group">
                            <label class="control-label">申请职位</label>
                            <span type="text" class="form-control" id="job"></span>
                        </div>
                        <div class="form-group">
                            <label class="control-label">手机</label>
                            <span type="text" class="form-control" id="mobile"></span>
                        </div>

                        <div class="form-group">
                            <label class="control-label">邮箱</label>
                            <span type="text" class="form-control" id="emai"></span>
                        </div>
                        <div class="form-group">
                            <label class="control-label">前景计划</label>
                            <span type="text" class="form-control" id="forward"></span>
                        </div>
                        <div class="form-group">
                            <label class="control-label">期待薪资</label>
                            <span type="text" class="form-control" id="expect_salar"></span>
                        </div>

                        <div class="form-group">
                            <label class="control-label">经历</label>
                            <span type="text" class="form-control" id="expression"></span>
                        </div>
                        <div class="form-group">
                            <label class="control-label">荣誉</label>
                            <span type="text" class="form-control" id="honor"></span>
                        </div>

                        <div class="form-group">
                            <label class="control-label">技能</label>
                            <span type="text" class="form-control" id="skill"></span>
                        </div>

                    </div>
                </div>
            </div>
        </div>
    </c:param>
</c:import>
